package com.key.mapper;

import com.key.common.R;
import com.key.common.dto.ReceiptDTO;
import com.key.common.dto.WithdrawalDTO;
import com.key.common.vo.AssetsTVO;
import com.key.entity.Assets;
import com.key.entity.ReceiptAssets;
import com.key.entity.WithdrawalAssets;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wen
 * @create 2023-02-21 18:24
 */
public interface WithdrawalAssetsMapper {
    //添加一个退库单据
    int insertWithdrawal(WithdrawalAssets withdrawalAssets);
    //依据单号删除
    int deleteWithdrawalAssetsByWithdrawalNumber(@Param("withdrawalNumber") String withdrawalNumber);

    //将退库单据与相关资产关联
    int updateWithdrawalAndAssets(@Param("withdrawalNumber") String withdrawalNumber, @Param("receiptNumber") String receiptNumber);

    //删除单据与资产的关联，实际为修改
    int deleteWithdrawalAndAssets(@Param("withdrawalNumber")String withdrawalNumber);

    //依据条件修改单
    int updateWithdrawalAssets(WithdrawalDTO withdrawalDTO);

    //依据条件查询退库单
    List<WithdrawalAssets> selectWithdrawal(WithdrawalDTO withdrawalDTO);

    //根据领用单号查找查询资产
    List<Assets> selectAssetsByWithdrawalAssetsNumber(@Param("withdrawalNumber") String withdrawalNumber );

     //根据领用单号查找查询资产
    List<AssetsTVO> selectAssetsVTOByWithdrawalAssetsNumber(@Param("withdrawalNumber") String withdrawalNumber );

    //查找条数
    int selectWithdrawalCount(WithdrawalDTO withdrawalDTO);


}
